package baiduApi;
import util.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.junit.Test;

import static com.alibaba.fastjson.JSON.parseObject;

/**
 * Created by 王念 on 2016/4/9.
 */
public class TieBaTest {
    String name="王念94";
    String url="http://tieba.baidu.com/home/get/getthread?un="+name+"&pn=3&ie=utf-8";
    @Test
    public void test(){

        String responStr= HttpUtil.get(url);
        JSONObject object= JSON.parseObject(responStr);
        System.out.println(object.get("error"));
        object.get("data");

    }
}
